package com.xbongbong.pro.statistic.service;

import com.alibaba.fastjson.JSONArray;
import com.xbongbong.paas.domain.entity.PaasFormExplainEntity;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.statistic.pojo.dto.ChartSubFormListDTO;
import com.xbongbong.pro.statistic.pojo.dto.SocketResultDTO;
import com.xbongbong.pro.statistic.pojo.vo.ChartSubFormListVO;
import com.xbongbong.pro.statistic.pojo.vo.SocketReckonVO;
import com.xbongbong.pro.statistic.result.pojo.SalesReportPojo;
import com.xbongbong.pro.statistic.result.pojo.dto.ChartPenetrateResultDTO;
import com.xbongbong.pro.statistic.result.pojo.dto.ChartResultAggDTO;
import com.xbongbong.pro.statistic.result.pojo.dto.ChartResultBaseDTO;
import com.xbongbong.pro.statistic.result.pojo.dto.ChartResultCallStatisticsDTO;
import com.xbongbong.pro.statistic.result.pojo.dto.ChartResultDTO;
import com.xbongbong.pro.statistic.result.pojo.dto.ChartResultPerformancePkDTO;
import com.xbongbong.pro.statistic.result.pojo.dto.DiyResultDTO;
import com.xbongbong.pro.statistic.result.pojo.vo.CallStatisticsVO;
import com.xbongbong.pro.statistic.result.pojo.vo.ChartResultAggVO;
import com.xbongbong.pro.statistic.result.pojo.vo.ChartResultDetailVO;
import com.xbongbong.pro.statistic.result.pojo.vo.ChartResultPkDetailVO;
import com.xbongbong.pro.statistic.result.pojo.vo.ChartResultPkVO;
import com.xbongbong.pro.statistic.result.pojo.vo.ChartResultVO;
import com.xbongbong.pro.statistic.result.pojo.vo.ChartResultValueVO;
import com.xbongbong.pro.statistic.result.pojo.vo.FundFlowVO;
import com.xbongbong.pro.statistic.result.pojo.vo.PerformanceFinishVO;
import com.xbongbong.pro.statistic.result.pojo.vo.SalesReportVO;

import java.util.List;

/**
 * 图表/指标统计结果相关
 * @author zcp
 * @version v1.0
 * @date 2019/3/27 15:44
 * @since v1.0
 */
public interface ChartResultService {

    /**
     * 自定义统计表汇总方法
     * @param chartResultAggDTO
     * @return
     * @throws XbbException
     */
    ChartResultAggVO chartRenderResultAgg(ChartResultAggDTO chartResultAggDTO) throws XbbException;
    /**
     * 获取图表结果
     * 使用chartIdIn维护图表id集合
     * @param chartResultDTO
     * @return com.xbongbong.pro.statistic.pojo.vo.ChartResultVO
     * @throws XbbException
     * @author zcp
     * @date 2019/2/13 13:56
     * @since v1.0
     * @version v1.0
     */
    ChartResultVO chartResult(ChartResultDTO chartResultDTO) throws XbbException;
    /**
     * @Description 更新解释信息
     * @param attrJsonArray, explainEntityList 解释信息集合, single , corpid
     * @return com.alibaba.fastjson.JSONArray
     * @author weiming
     * @Date  2020/10/27/16:44
     * @since
     **/
    JSONArray updateExplain(JSONArray attrJsonArray, List<PaasFormExplainEntity> explainEntityList, Integer single, String corpid) throws XbbException;
    /**
     * @Description 更新查询条件的解释信息
     * @param attrJsonArray, explainEntityList, single, corpid
     * @return com.alibaba.fastjson.JSONArray
     * @author weiming
     * @Date  2020/10/27/16:44
     * @since
     **/
    JSONArray updateSearchExplain(JSONArray attrJsonArray, List<PaasFormExplainEntity> explainEntityList, Integer single, String corpid) throws XbbException;

    /**
     * 获取图表结果
     * @param chartPenetrateResultDTO 入参
     * @return com.xbongbong.pro.statistic.pojo.vo.ChartPenetrateResultDTO
     * @author zhouwq
     * @date 2019/4/18 19:08
     * @throws XbbException error
     */
    ChartResultVO chartPenetrateResult(ChartPenetrateResultDTO chartPenetrateResultDTO) throws XbbException;

    /**
     * webSocket统计专用请求接口
     * @param socketResultDTO
     * @return com.xbongbong.pro.statistic.pojo.vo.ChartResultVO
     * @throws XbbException
     * @author youli.chen
     * @date 2019/2/13 13:56
     * @since v1.0
     * @version v1.0
     */
    SocketReckonVO socketReckon(SocketResultDTO socketResultDTO) throws XbbException;

    /**
     * 获取简报看板，遗忘提醒，客户关怀数据
     * 使用chartIdIn维护图表id集合
     *
     * @param chartResultDTO 图表id数组，筛选的部门id/筛选的员工id，时间筛选参数
     * @return com.xbongbong.pro.statistic.pojo.vo.ChartResultVO
     * @throws XbbException
     * @author 徐俊杰
     * @date 2019/3/11 15:43
     * @since v1.0
     */
    ChartResultValueVO chartResultValue(ChartResultDTO chartResultDTO) throws XbbException;

    /**
     * 业绩目标
     * 首页业绩目标、web完成情况详情页、app端列表页
     * 使用chartIdIn维护图表id集合
     * @param chartResultDTO 请求参数
     * @return com.xbongbong.pro.statistic.pojo.vo.ChartResultPkDetailVO
     * @throws XbbException
     * @author zcp
     * @date 2019/3/27 20:51
     * @since v1.0
     * @version v1.0
     */
    ChartResultPkDetailVO chartResultPerformance(ChartResultDTO chartResultDTO) throws XbbException;

    /**
     * pk榜
     * @param chartResultDTO 请求参数
     * @return com.xbongbong.pro.statistic.pojo.vo.ChartResultPkVO
     * @throws XbbException
     * @author zcp
     * @date 2019/3/18 16:47
     * @since v1.0
     * @version v1.0
     */
    ChartResultPkVO chartResultPk(ChartResultDTO chartResultDTO) throws XbbException;

    /**
     * 获取pk榜范围设置pk结果
     * @param chartResultDTO 请求参数
     * @return com.xbongbong.pro.statistic.pojo.vo.ChartResultPkVO
     * @throws XbbException
     * @author youli.chen
     * @date 2020/9/9 16:47
     * @since v1.0
     * @version v1.0
     */
    ChartResultPkVO chartResultRulePk(ChartResultDTO chartResultDTO) throws XbbException;

    /**
     * 员工目标完成情况：目标完成情况详情穿透（人员完成率排行），所有员工的所有指标（在考核对象内）的完成情况
     * @param chartResultPerformancePkDTO
     * @return com.xbongbong.pro.statistic.result.pojo.vo.ChartResultPkDetailVO
     * @throws XbbException
     * @author zcp
     * @date 2019/4/3 13:51
     * @since v1.0
     * @version v1.0
     */
    ChartResultPkDetailVO chartResultPerformancePk(ChartResultPerformancePkDTO chartResultPerformancePkDTO) throws XbbException;
    /**
     * 目标完成情况列表
     * @param chartResultBaseDTO
     * @return com.xbongbong.paas.pojo.vo.PerformanceFinishVO
     * @throws XbbException
     * @author zcp
     * @date 2019/4/1 19:22
     * @since v1.0
     * @version v1.0
     */
    PerformanceFinishVO chartResultPerformanceFinish(ChartResultBaseDTO chartResultBaseDTO) throws XbbException;

    /**
     * 员工呼出/呼入统计
     * @param chartResultCallStatisticsDTO
     * @return com.xbongbong.paas.pojo.vo.CallStatisticsVO
     * @throws XbbException
     * @author zcp
     * @date 2019/4/1 19:22
     * @since v1.0
     * @version v1.0
     */
    CallStatisticsVO chartResultCallStatistics(ChartResultCallStatisticsDTO chartResultCallStatisticsDTO) throws XbbException;

    /**
     * 员工呼出/呼入统计总计
     * @param chartResultCallStatisticsDTO
     * @return com.xbongbong.paas.pojo.vo.CallStatisticsVO
     * @throws XbbException
     * @author zcp
     * @date 2019/4/1 19:22
     * @since v1.0
     * @version v1.0
     */
    CallStatisticsVO chartResultCallStatisticsTotal(ChartResultCallStatisticsDTO chartResultCallStatisticsDTO) throws XbbException;

    /**
     * 获取多表自定义统计的值
     * @param diyResultDTO
     * @return
     * @throws XbbException
     */
    ChartResultDetailVO gitDiyResult(DiyResultDTO diyResultDTO) throws XbbException;

    /**
     * 统计销售简报结果，并入库tb_target_log
     * @param salesReportPojo
     * @return com.xbongbong.pro.statistic.result.pojo.vo.SalesReportVO
     * @throws XbbException
     * @author zcp
     * @date 2019/4/17 13:37
     * @since v1.0
     * @version v1.0
     */
    SalesReportVO chartResultSalesReport(SalesReportPojo salesReportPojo) throws XbbException;

    /**
     * 首页-资金流转-数据获取
     *
     * @param chartResultDTO 首页-资金流转-入参
     * @return com.xbongbong.pro.statistic.result.pojo.vo.FundFlowVO
     * @throws XbbException 异常
     * @author 徐俊杰
     * @date 2020/3/12 10:21
     * @since v1.0
     */
    FundFlowVO getFundFlow(ChartResultDTO chartResultDTO) throws XbbException;

    /**
     * 获取子表单数据
     * @param chartSubFormListDTO 入参
     * @return ChartSubFormListVO
     * @throws XbbException error
     * @author zhouwq
     * @date 2020/9/29 9:05
     */
    ChartSubFormListVO chartGetSubFormList(ChartSubFormListDTO chartSubFormListDTO) throws XbbException;
}
